package com.wmg.controller;

import com.wmg.anno.RequireLogin;
import com.wmg.common.JsonResult;
import com.wmg.entity.User;
import com.wmg.service.TestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TestController {
    public static Logger log = LoggerFactory.getLogger(TestController.class);

    @Autowired
    private TestService testService;

    @RequestMapping("test.do")
    @ResponseBody
    @RequireLogin(value = "test")
    public JsonResult<User> test(String username) {
        log.info("controller {}", "哈哈");
        return testService.str();
    }
}
